package com.platform.hjt.sys.model;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * SysUserModel entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "sys_user_model")
public class SysUserModel implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = -329548931672578384L;
	private SysUserModelId id;
	private SysUserInfo sysUserInfo;
	private SysModel sysModel;

	// Constructors

	/** default constructor */
	public SysUserModel() {
	}

	
	public SysUserModel(SysUserModelId id) {
		this.id = id;
	}
	
	/** full constructor */
	public SysUserModel(SysUserModelId id, SysUserInfo sysUserInfo,
			SysModel sysModel) {
		this.id = id;
		this.sysUserInfo = sysUserInfo;
		this.sysModel = sysModel;
	}

	// Property accessors
	@EmbeddedId
	@AttributeOverrides({
			@AttributeOverride(name = "sysModelId", column = @Column(name = "sys_model_id", nullable = false, length = 32)),
			@AttributeOverride(name = "sysUserInfoId", column = @Column(name = "sys_user_info_id", nullable = false, length = 32)) })
	public SysUserModelId getId() {
		return this.id;
	}

	public void setId(SysUserModelId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "sys_user_info_id", nullable = false, insertable = false, updatable = false)
	public SysUserInfo getSysUserInfo() {
		return this.sysUserInfo;
	}

	public void setSysUserInfo(SysUserInfo sysUserInfo) {
		this.sysUserInfo = sysUserInfo;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "sys_model_id", nullable = false, insertable = false, updatable = false)
	public SysModel getSysModel() {
		return this.sysModel;
	}

	public void setSysModel(SysModel sysModel) {
		this.sysModel = sysModel;
	}

}